import React, {PropsWithChildren} from 'react';
import {View} from 'react-native';
import {useSafeAreaInsets} from 'react-native-safe-area-context';

/**
 * 提供安全区域处理的布局组件，确保内容不会与状态栏重叠
 */
const SafeAreaLayout = (props: PropsWithChildren) => {
  const {top} = useSafeAreaInsets();
  return (
    <View
      {...props}
      className="flex-1"
      style={{
        paddingTop: top,
      }}
    />
  );
};
export default SafeAreaLayout;
